﻿namespace WatiN.Extensions
{
    using global::WatiN.Core;

    public static class ListCollectionExtensions
    {
        public static bool Exists(this ListCollection listCollection, string listIdOrNameOrValueorClass, bool extension = true)
        {
            return listCollection.Exists(Find.ById(listIdOrNameOrValueorClass)) ||
                listCollection.Exists(Find.ByName(listIdOrNameOrValueorClass)) ||
                listCollection.Exists(Find.ByValue(listIdOrNameOrValueorClass)) ||
                listCollection.Exists(Find.ByClass(listIdOrNameOrValueorClass)) ||
                listCollection.Exists(Find.ByLabelText(listIdOrNameOrValueorClass));
        }
    }
}